/*
 * PaintableCity.fx
 *
 * Created on 2010-11-13, 17:09:24
 */

package pl.elka.gis.main.view;

import javafx.scene.CustomNode;
import javafx.scene.Group;
import javafx.scene.shape.Circle;
import javafx.scene.paint.Color;
import javafx.scene.text.Text;
import javafx.scene.layout.HBox;
import pl.elka.gis.main.PaintingHints;
import pl.elka.gis.main.PositionCounter;
import pl.elka.gis.main.node.Node;

/**
 * @author looser
 */

public class PaintableNode extends CustomNode{
    public var node:Node;
    public var hints:PaintingHints;

    override protected function create () : javafx.scene.Node {
        Group{
            layoutX:PositionCounter.countXPos(node.getX(), hints);
            layoutY:PositionCounter.countYPos(node.getY(), hints);
            content: [
                HBox{
                    content: [                        
                        Circle{
                            radius:7
                            fill: Color.ROYALBLUE
                            translateX:-6,
                            translateY:-6
                        }
                        Text{
                            content:node.getName();
                        }
                    ]
                }
            ]
        }
    }
}
